package reflect;

import reflect.annotations.AutoRunClass;

public class ReflectDemo11 {
    public static void main(String[] args) throws ClassNotFoundException {
        //查看Person类上是否被注解@AutoRunClass注解
        //1.获取类对象
        Class cls = Class.forName("reflect.Person");
        //2.通过类对象查看是否被指定注解标注
        boolean mark = cls.isAnnotationPresent(AutoRunClass.class);
        if (mark) {
            System.out.println("该类被注解标注");
        } else {
            System.out.println("该类没有被注解标注");
        }
    }
}
